#include <iostream>

using namespace std;

class TuGiac 
{
protected :
	int chieudai ;
	int chieurong ;

public :
	TuGiac()
	{}
	virtual void Nhap();
	virtual int ChuVi();
	virtual double DienTich();
};

class HinhChuNhat : TuGiac
{
public:

	virtual void Nhap()
	{
		cout<<"Nhap chieu dai : ";
		cin>>chieudai;
		cout<<"Nhap chieu rong : ";
		cin>>chieurong;
	}
	virtual int ChuVi()
	{
		cout<< " Chu Vi la : " << 2*(chieudai + chieurong) << "\n";

	}
	virtual double DienTich()
	{
		cout<< "Dien Tich la : " << chieudai * chieurong << "\n" ;
	}
};

class HinhVuong : TuGiac
{
public:
	virtual void Nhap()
	{
		cout<<"Nhap canh hinh vuong : " ;
		cin>>chieudai;
		chieurong = chieudai;
	}
	virtual int ChuVi()
	{
		cout<< " Chu Vi la : " << 4*chieudai << "\n";
	}
	virtual double DienTich()
	{
		cout<< " Dien Tich la : " << chieudai * chieudai << "\n"; 
	}
};

class HinhBinhHanh : TuGiac
{
private :
	int chieucao;
public:
	virtual void Nhap()
	{
		cout<<"Nhap chieu dai : ";
		cin>>chieudai;
		cout<<"Nhap chieu rong : ";
		cin>>chieurong;
		cout<<"Nhap chieu cao : ";
		cin>>chieucao;
	}
	virtual int ChuVi()
	{
		cout<< " Chu Vi la : " << 2*chieudai + 2*chieurong << "\n";
	}
	virtual double DienTich()
	{
		cout<< " Dien Tich la : " <<(chieudai * chieucao) << "\n"; 
	}
};

class HinhThoi : TuGiac
{
private:
	int gocnhon;
public:
	virtual void Nhap()
	{
		cout<<"Nhap canh hinh thoi : ";
		cin>>chieudai;
		chieurong = chieudai;
		cout<<"Nhap so do goc nhon : ";
		cin>>gocnhon;
	}
	virtual int ChuVi()
	{
		cout<< " Chu Vi la : " << 4*chieudai << "\n";
	}
	virtual double DienTich()
	{
		cos
		cout<< " Dien Tich la : " <<(chieudai * chieucao) << "\n"; 
	}

};